/*************************************
 * Created by WebStorm
 * Author : 艾尼亚尔·毛拉吾提
 * QQ : 524155792  WeChat : ainiyar0124
 * Created Time :2025/1/21 14:35
 Desc :
 **************************************/
import {createRouter, createWebHistory} from 'vue-router'
import {createRouterGuards} from "@/router/guards.ts";
import {useAsyncRouteStoreWidthOut} from "@/store/models/app.ts";

export const setupRouter = async () => {
    const asyncRouteStore = useAsyncRouteStoreWidthOut();
    const router = createRouter({
        history: createWebHistory(import.meta.env.BASE_URL),
        routes: asyncRouteStore.preProcessingRoutes(),
        strict: true,
    });
    createRouterGuards(router);
    return router
}